
/**************************************************************************
** 
** File name   : Daniels_ISQ_replication.do
** Date        : 1 January 2020
** Author      : Lesley-Ann Daniels (ldaniels@ibei.org)
** Purpose     : Replicates main results of "Stick then carrot: When do governments give amnesty during civil war? (International Studies Quarterly)"
** Requires    : Daniels_ISQ_data.dta, eststo.ado, estout.ado
** Output      : Daniels_ISQ_replication.log
**
**************************************************************************/

** Table 1

sort dyadid year
tsset dyadid year

eststo, title("Model 1"): quietly logit amnesty  lnrebdeathl lngovdeathl   v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  if ampa !=1, cluster (dyadid)
eststo, title("Model 2"): quietly logit amnesty  lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  if ampa !=1, cluster (dyadid)
eststo, title("Model 3"): quietly logit amnesty  lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
estout, cells(b(star  fmt(%9.3f)) se(par fmt(2))) label varlabels(_cons Constant) title(Effects of amnesty) stats(N ll aic bic, label(Observations Pseudologlikelihood AIC BIC)) starlevels(* 0.10 ** 0.05 *** 0.01)
eststo clear


** Figure 1

quietly logit amnesty  lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
margins, at(lnrebdeathl=(0 1.61 3.79 5.97 8.873)) 
marginsplot, ///
  title("")  ///
  ytitle("Predicted probability of amnesty") ///
  xtitle("Level of rebel deaths, log and lag") ///
  xlabel(0 "0" 1.61 "- 1 sd" 3.79 "mean" 5.97 "+ 1 sd" 8.873 "max") ///
  plot1(color(black)) ///
  graphregion(color(white)) ///
  legend(off)
  
 
** Robustness checks

*Table A3 Tests on model 3
*with ukpo
eststo, title("Model A3.1"): quietly logit amnesty unpko meanunpko lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
*with democracy breakdowns (Boix et al)
eststo, title("Model A3.2"): quietly logit amnesty democracy_breakdowns  meandemocracy_breakdowns lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
*with resources (Lujala)
eststo, title("Model A3.3"): quietly logit amnesty resource  meanresource lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
*with other dyads in conflict
eststo, title("Model A3.4"): quietly logit amnesty numdyadconfl meannumdyadconfl lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
*with alternative measure of intensity
eststo, title("Model A3.5"): quietly logit amnesty intensityl meanintensityl lnrebdeathl    rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl   meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1, cluster (dyadid)
*without FARC
eststo, title("Model A3.6"): quietly logit amnesty  lnrebdeathl lngovdeathl   rebstrcgs3l v2x_polyarchyl lgdppcMadl  meanlnrebdeathl meanlngovdeathl  meanrebstrcgs meanv2x_polyarchyl  durdyad durdyad2 durdyad3 meandurdyad    meanlgdppcMadl  pastdyadam picc meanpastdyadam meanpicc if ampa !=1 & dyadid !=237, cluster (dyadid)
*as linear probability model
xtset dyadid year
eststo, title("Model A3.7"): quietly xtreg amnesty  lnrebdeathl lngovdeathl rebstrcgs3l v2x_polyarchyl  lgdppcMadl durdyad durdyad2 durdyad3 pastdyadam picc if ampa !=1, fe
eststo, title("Model A3.8"): quietly xtlogit amnesty  lnrebdeathl lngovdeathl rebstrcgs3l v2x_polyarchyl  lgdppcMadl durdyad durdyad2 durdyad3 pastdyadam picc if ampa !=1, fe
estout, cells(b(star  fmt(%9.3f)) se(par fmt(2))) label varlabels(_cons Constant) title(Effects of amnesty) stats(N ll aic bic, label(Observations Pseudologlikelihood AIC BIC)) starlevels(* 0.10 ** 0.05 *** 0.01)
eststo clear




